package com.ruoyi.equipment.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.equipment.mapper.CampusEquipmentMapper;
import com.ruoyi.equipment.domain.CampusEquipment;
import com.ruoyi.equipment.service.ICampusEquipmentService;

/**
 * 后勤设备Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-03
 */
@Service
public class CampusEquipmentServiceImpl implements ICampusEquipmentService 
{
    @Autowired
    private CampusEquipmentMapper campusEquipmentMapper;

    /**
     * 查询后勤设备
     * 
     * @param equipmentId 后勤设备主键
     * @return 后勤设备
     */
    @Override
    public CampusEquipment selectCampusEquipmentByEquipmentId(Long equipmentId)
    {
        return campusEquipmentMapper.selectCampusEquipmentByEquipmentId(equipmentId);
    }

    /**
     * 查询后勤设备列表
     * 
     * @param campusEquipment 后勤设备
     * @return 后勤设备
     */
    @Override
    public List<CampusEquipment> selectCampusEquipmentList(CampusEquipment campusEquipment)
    {
        return campusEquipmentMapper.selectCampusEquipmentList(campusEquipment);
    }

    /**
     * 新增后勤设备
     * 
     * @param campusEquipment 后勤设备
     * @return 结果
     */
    @Override
    public int insertCampusEquipment(CampusEquipment campusEquipment)
    {
        campusEquipment.setCreateTime(DateUtils.getNowDate());
        return campusEquipmentMapper.insertCampusEquipment(campusEquipment);
    }

    /**
     * 修改后勤设备
     * 
     * @param campusEquipment 后勤设备
     * @return 结果
     */
    @Override
    public int updateCampusEquipment(CampusEquipment campusEquipment)
    {
        campusEquipment.setUpdateTime(DateUtils.getNowDate());
        return campusEquipmentMapper.updateCampusEquipment(campusEquipment);
    }

    /**
     * 批量删除后勤设备
     * 
     * @param equipmentIds 需要删除的后勤设备主键
     * @return 结果
     */
    @Override
    public int deleteCampusEquipmentByEquipmentIds(Long[] equipmentIds)
    {
        return campusEquipmentMapper.deleteCampusEquipmentByEquipmentIds(equipmentIds);
    }

    /**
     * 删除后勤设备信息
     * 
     * @param equipmentId 后勤设备主键
     * @return 结果
     */
    @Override
    public int deleteCampusEquipmentByEquipmentId(Long equipmentId)
    {
        return campusEquipmentMapper.deleteCampusEquipmentByEquipmentId(equipmentId);
    }
}
